package com.joolun.web.api;

import com.joolun.common.core.domain.AjaxResult;
import com.joolun.tennis.domain.Club;
import com.joolun.tennis.domain.TennisAd;
import com.joolun.tennis.domain.WxUserClub;
import com.joolun.tennis.service.ITennisAdService;
import com.joolun.weixin.utils.ThirdSessionHolder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/common")
@Api(value = "common", tags = "公共API")
public class CommonApi {

    private final ITennisAdService tennisAdService;
    /**
     * 查询广告清单
     * @return R
     */
    @ApiOperation(value = "通过id查询俱乐部")
    @GetMapping("/ad")
    public AjaxResult getById(HttpServletRequest request){
        TennisAd ad = new TennisAd();
        ad.setDeleted(0);
        ad.setEnabled(1);
//        tennisAdService.selectTennisAdList(ad);
        return AjaxResult.success(tennisAdService.selectTennisAdList(ad));
    }
}
